package com.third.servicethird.controller;

import com.third.servicethird.util.SmsComponent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/third")
@RestController
public class SMSController {


    // 验证码模板id
    @Value("${spring.cloud.alicloud.sms.codeTemplateId}")
    private String codeTemplateId;

    // 卖车人员接收短信模板id
    @Value("${spring.cloud.alicloud.sms.sellTemplateId}")
    private String sellTemplateId;

    @Autowired
    private SmsComponent smsComponent;

    /**
     * 发送短信验证码
     * @param phone
     * @param code
     */
    @RequestMapping("/sms/sendCode")
    public void sendSmsCode(@RequestParam("phone") String phone, @RequestParam("code") String code){
        //smsComponent.sendSmsCode(phone,code,codeTemplateId);
    }

    /**
     * 卖车人员接收的短信
     * @param phone
     */
    @RequestMapping("/sms/sendSellMsg")
    public void sendSellCode(@RequestParam("phone") String phone){
        //smsComponent.sendSmsCode(phone,null,sellTemplateId);
    }

}
